package com.hrp.controller;

import com.hrp.domain.ResponseData;
import com.hrp.domain.UimmsPrice;
import com.hrp.domain.UimmsReceiveMoney;
import com.hrp.domain.User;
import com.hrp.service.PriceSettingService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Created by Administrator on 2019/5/6 0006.
 */
@RestController
@RequestMapping("priceSetting")
public class PriceSettingController {

    @Autowired
    private PriceSettingService priceSettingService;


    @RequestMapping("/getPriceSettingByPage")
    public Map<String,Object> getPriceSettingByPage(Integer page, Integer rows) {
        return priceSettingService.getPriceSettingByPage(page,rows);
    }


    @RequestMapping("/savePriceSetting")
    public ResponseData savePriceSetting(UimmsPrice uimmsPrice) {
        User acount = (User) SecurityUtils.getSubject().getPrincipal();
        uimmsPrice.setCzry(acount.getUsername());
        return priceSettingService.savePriceSetting(uimmsPrice);
    }

    @RequestMapping("/batchUpdatePrice")
    public ResponseData batchUpdatePrice(Integer id) {
        return priceSettingService.batchUpdatePrice(id);
    }


}
